﻿<Window x:Class="MakePanoForGoogle.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MakePanoForGoogle" Height="330" Width="1000"
        x:Name="win1"
        AllowDrop="True"
        Background="Beige"
        Icon="MakePanoForGoogle.ico"
        DragEnter="Gps_DragVerify"
        DragOver="Gps_DragVerify"
        DragLeave="Gps_DragVerify"
        Drop="Gps_Drop"
        Closed="win1_Closed"
        >
<!-- MakePanoForGoogle, Copyright Mirosław M. Mączka.  All Rights Reserved. This code released under the terms of the Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.) -->

    <Window.Resources>
        
        <Style TargetType="TextBlock">
            <Setter Property="TextAlignment" Value="Right"></Setter>
            <Setter Property="Margin" Value="5,5,0,0"></Setter>
            <Setter Property="Background" Value="BlanchedAlmond"/>
            <Setter Property="AllowDrop" Value="True"/>
        </Style>
        
        <Style x:Key="inputField" TargetType="{x:Type TextBox}">
            <Setter Property="Margin" Value="5,5,10,0"/>
            <Setter Property="HorizontalContentAlignment" Value="Right"/>
            <Setter Property="AllowDrop" Value="True"/>
        </Style>
        
        <SolidColorBrush x:Key="BrushColumbiaBlue" Color="#9BDDFF"/>
        <!--Columbia blue-->
        <SolidColorBrush x:Key="BrushBabyPink" Color="#F4C2C2"/>
        <!--Baby pink-->

        <TextBlock x:Key="ttImage" Background="{StaticResource BrushColumbiaBlue}">
            <Run FontSize="14" Foreground="Blue" FlowDirection="LeftToRight">Drop here an image to create panorama</Run>, 
            <LineBreak/>
            <Run FontSize="12">from ICE</Run>
        </TextBlock>

        <TextBlock x:Key="ttMaxMPixels" Background="{StaticResource BrushBabyPink}">
            <Run FontSize="14" Foreground="Blue" FlowDirection="LeftToRight">Greatest quantity (millions) of pixels in image</Run>
            <LineBreak/>
            <Run FontSize="12">Limit of Google</Run>
            <LineBreak/>
            <Run FontSize="12">^Z - reset to default</Run>
        </TextBlock>

        <TextBlock x:Key="ttMaxMegaBytes" Background="{StaticResource BrushBabyPink}">
            <Run FontSize="14" Foreground="Blue" FlowDirection="LeftToRight">Maximal length of file in megabytes</Run>
            <LineBreak/>
            <Run FontSize="12">Limit of Google</Run>
            <LineBreak/>
            <Run FontSize="12">^Z - reset to default</Run>
        </TextBlock>

        <TextBlock x:Key="ttVerticalSpan" Background="{StaticResource BrushColumbiaBlue}">
            <Run FontSize="14" Foreground="Blue" FlowDirection="LeftToRight">0° - 360°</Run>
            <LineBreak/>
            <Run FontSize="12">Copy from ICE</Run>
            <LineBreak/>
            <Run FontSize="12">Drop here file with data</Run>
        </TextBlock>

        <TextBlock x:Key="ttHorizontalSpan" Background="{StaticResource BrushColumbiaBlue}">
            <Run FontSize="14" Foreground="Blue" FlowDirection="LeftToRight">0° - 360°</Run>
            <LineBreak/>
            <Run FontSize="12">Copy from ICE</Run>
            <LineBreak/>
            <Run FontSize="12">Drop here file with data</Run>
        </TextBlock>

        <TextBlock x:Key="ttPoseHeadingDegrees">
            <Run FontSize="14" Foreground="Blue" FlowDirection="LeftToRight">Angle to North: 0° - 360°</Run>
            <LineBreak/>
            <Run FontSize="12">Click on image to set</Run>
        </TextBlock>

        <TextBlock x:Key="ttLatitude">
            <Run FontSize="14" Foreground="Blue" FlowDirection="LeftToRight">Latitude</Run>
            <LineBreak/>
            <Run FontSize="12">Drop here file with data</Run>
            <LineBreak/>
            <Run FontSize="12">Drop here an image with GPS data</Run>
        </TextBlock>
        
        <TextBlock x:Key="ttLongitude">
            <Run FontSize="14" Foreground="Blue" FlowDirection="LeftToRight">Longitude</Run>
            <LineBreak/>
            <Run FontSize="12">Drop here file with data</Run>
            <LineBreak/>
            <Run FontSize="12">Drop here an image with GPS data</Run>
        </TextBlock>

        <TextBlock x:Key="ttDayTaken">
            <Run FontSize="14" Foreground="Blue" FlowDirection="LeftToRight">Date of the picture</Run>
        </TextBlock>
        
        <TextBlock x:Key="ttDescription">
            <Run FontSize="14" Foreground="Blue" FlowDirection="LeftToRight">Description of panorama</Run>
        </TextBlock>



    </Window.Resources>

    <Grid  AllowDrop="True">
        <Grid.RowDefinitions>
            <RowDefinition x:Name="r1" Height="100"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="175"/>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="50"/>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Image x:Name="image1" Grid.Row="0" ToolTip="{StaticResource ttImage}" AllowDrop="True" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" 
               Grid.ColumnSpan="7"
               Visibility="Visible"
               Stretch="Fill"
               DragEnter="image1_DragVerify" DragOver="image1_DragVerify" DragLeave="image1_DragVerify" Drop="image1_Drop"
               MouseLeftButtonDown="image1_MouseLeftButtonDown"
               Source="image2.png"
               />
        
        
        <TextBlock Grid.Row="1" Grid.Column="1" Text="Max MegaPixels"/>
        <TextBox Grid.Row="1" Grid.Column="2" x:Name="txtMaxMPixels" Text="50" PreviewKeyDown="txtMaxMega_PreviewKeyDown" PreviewTextInput="txtPreview_IntegerNumber" ToolTip="{StaticResource ttMaxMPixels}" Background="{StaticResource BrushBabyPink}" Style="{StaticResource inputField}" AllowDrop="True" PreviewDragOver="Gps_DragVerify" PreviewDrop="Gps_Drop"/>

        <TextBlock Grid.Row="2" Grid.Column="1" Text="Max FileSize MB"/>
        <TextBox Grid.Row="2"  Grid.Column="2" x:Name="txtMaxMegaBytes" Text="20" PreviewKeyDown="txtMaxMega_PreviewKeyDown" PreviewTextInput="txtPreview_IntegerNumber" ToolTip="{StaticResource ttMaxMegaBytes}" Background="{StaticResource BrushBabyPink}" Style="{StaticResource inputField}" AllowDrop="True" PreviewDragOver="Gps_DragVerify" PreviewDrop="Gps_Drop"/>

        <TextBlock  Grid.Row="3" Grid.Column="1" Text="Vertical Span"/>
        <TextBox Grid.Row="3" Grid.Column="2" x:Name="txtVerticalSpan" Text="0.0" TextChanged="textChanged_FloatNumber" ToolTip="{StaticResource ttVerticalSpan}" Background="{StaticResource BrushColumbiaBlue}" Style="{StaticResource inputField}" AllowDrop="True" PreviewDragOver="Gps_DragVerify" PreviewDrop="Gps_Drop"/>

        <TextBlock Grid.Row="4" Grid.Column="1" Text="Horizontal Span"/>
        <TextBox Grid.Row="4" Grid.Column="2" x:Name="txtHorizontalSpan" Text="360.0"  TextChanged="textChanged_FloatNumber" ToolTip="{StaticResource ttHorizontalSpan}" Background="{StaticResource BrushColumbiaBlue}" Style="{StaticResource inputField}" AllowDrop="True" PreviewDragOver="Gps_DragVerify" PreviewDrop="Gps_Drop"/>
<!---->
        <TextBlock Grid.Row="5" Grid.Column="4" Text="Heading"/>
        <TextBox Grid.Row="5" Grid.Column="5" x:Name="txtPoseHeadingDegrees" Text="0" PreviewTextInput="txtPreview_IntegerNumber" ToolTip="{StaticResource ttPoseHeadingDegrees}" Style="{StaticResource inputField}" AllowDrop="True" PreviewDragOver="Gps_DragVerify" PreviewDrop="Gps_Drop"/>


        <TextBlock Grid.Row="1" Grid.Column="4" Text="Latitude"/>
        <TextBox Grid.Row="1" Grid.Column="5" x:Name="txtLatitude" Text="0,0" TextChanged="textChanged_FloatNumber" ToolTip="{StaticResource ttLatitude}" Style="{StaticResource inputField}" AllowDrop="True" PreviewDragOver="Gps_DragVerify" PreviewDrop="Gps_Drop"/>

        <TextBlock Grid.Row="2" Grid.Column="4" Text="Longitude"/>
        <TextBox Grid.Row="2" Grid.Column="5" x:Name="txtLongitude" Text="0,0" TextChanged="textChanged_FloatNumber" ToolTip="{StaticResource ttLongitude}" Style="{StaticResource inputField}" AllowDrop="True" PreviewDragOver="Gps_DragVerify" PreviewDrop="Gps_Drop"/>

        <TextBlock Grid.Row="3" Grid.Column="4" Text="Day"/>
        <TextBox Grid.Row="3" Grid.Column="5" x:Name="txtDayTaken" Text="" ToolTip="{StaticResource ttDayTaken}" Style="{StaticResource inputField}" AllowDrop="True" PreviewDragOver="Gps_DragVerify" PreviewDrop="Gps_Drop"/>

        <TextBlock Grid.Row="4" Grid.Column="4" Text="Description"/>
        <TextBox Grid.Row="4" Grid.Column="5" x:Name="txtDescription" Text="" ToolTip="{StaticResource ttDescription}" Style="{StaticResource inputField}" AllowDrop="True" PreviewDragOver="Gps_DragVerify" PreviewDrop="Gps_Drop"/>
<!---->

        <Button Grid.Row="6" Grid.Column="0" Margin="25" Background="{StaticResource BrushColumbiaBlue}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" x:Name="buttonICE" Content="➜ ICE" FontWeight="ExtraBold" ToolTip="http://research.microsoft.com/en-us/um/redmond/groups/ivm/ice/" Click="buttonICE_Click"/>

        <Button Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="3" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="15,10,15,10" x:Name="buttonDo" Content="Do!" FontSize="20" FontWeight="ExtraBold" Click="do_Click"/>

        <Button Grid.Row="6" Grid.Column="5" Margin="25" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" x:Name="buttonPhotos" Content="➜ Photos" FontWeight="ExtraBold" ToolTip="https://plus.google.com/photos" Click="buttonPhotos_Click"/>

        <Button Grid.Row="6" Grid.Column="6" Margin="25" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" x:Name="buttonViews" Content="➜ Views" FontWeight="ExtraBold" ToolTip="https://www.google.com/maps/views/home" Click="buttonViews_Click"/>
    </Grid>


</Window>
